package com.jarvis.zeng.design.pattern.composite.factory;

import com.jarvis.zeng.design.pattern.simple.factory.Rectangle;

/**
 * @author ZengJun
 */
public class Main {
    public static void main(String[] args) {
        ShapeFactory shapeFactory = TemplateFactory.getFactory(ShapeFactory.class.getName());
        shapeFactory.getShape(Rectangle.class.getName()).draw();

        ColorFactory colorFactory = TemplateFactory.getFactory(ColorFactory.class.getName());
        colorFactory.getColor(RedColor.class.getName()).fill();
    }
}
